new Vue({
  el: '#app',
  data: {
    apiUrl: 'http://csrmgtwxuat.aeonlife.com.cn/app/csrmgtwx/app/getUserInfo',
    apiParams: '{"tokenCode":"d5d7f853dcd747a3a9d8f8395c90c078"}',
    responseData: null,
    errorMessage: '',
    isLoading: false
  },
  created() {
    this.handleRequest();
  },
  methods: {
    async handleRequest() {
      try {
        this.errorMessage = '';
        const params = JSON.parse(this.apiParams || '{}');
        this.responseData = await networkPost(this.apiUrl, params);
      } catch (error) {
        this.errorMessage = `请求失败: ${error.message}`;
        this.responseData = null;
      }
    },
    formatResponse(data) {
      return JSON.stringify(data, null, 2);
    }
  }
})
